﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DB
{
    abstract class DatabaseConnection

    {
        private string connectionString;

        public TimeSpan TimeOut { get; private set; }

        public string ConnectionString
        {
            get
            {
                return connectionString;
            }
            set
            {
                if(String.IsNullOrWhiteSpace(value))
                {
                    throw new ArgumentNullException("string is empty");
                }
                else
                connectionString = value;
            }
        }

        public DatabaseConnection(string connectionString, TimeSpan timeout)
        {
            ConnectionString = connectionString;
            TimeOut = timeout;
        }

        public abstract void OpenConnection();

        public abstract void CloseConnection();
        

    }
}
